﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TianShu.Untils.Encrypt
{
    public interface IRsaEncrypt
    {
		string GetPublicKey();

		/// <summary>
		/// RSA decrypt method
		/// </summary>
		/// <param name="privateKey">SA algorithm private key</param>
		/// <param name="decryptstring">A string that need to be decrypted</param>
		/// <returns></returns>
		string Decrypt(string privateKey, string decryptstring);
		/// <summary>
		/// RSA decrypt method
		/// </summary>
		/// <param name="privateKey">SA algorithm private key</param>
		/// <param name="decryptstring">A string that need to be decrypted</param>
		/// <returns></returns>
		string Decrypt(string decryptstring);
		/// <summary>
		/// this is RSA encrypt method.
		/// </summary>
		/// <param name="publicKey">RSA algorithm public key</param>
		/// <param name="encryptstring">A string that needs to be encrypted</param>
		/// <returns></returns>
		string Encrypt(string publicKey, string encryptstring);

		/// <summary>
		/// this is RSA encrypt method.
		/// </summary>
		/// <param name="publicKey">RSA algorithm public key</param>
		/// <param name="encryptstring">A string that needs to be encrypted</param>
		/// <returns></returns>
		string Encrypt(string encryptstring);


		/// <summary>
		/// 用私钥给数据进行RSA加密
		/// </summary>
		/// <param name="xmlPrivateKey"></param>
		/// <param name="strEncryptString"></param>
		/// <returns></returns>
		string PrivateKeyEncrypt(string xmlPrivateKey, string strEncryptString);

		/// <summary>
		/// 用公钥给数据进行RSA解密 
		/// </summary>
		/// <param name="xmlPublicKey"> 公钥(XML格式字符串) </param>
		/// <param name="strDecryptString"> 要解密数据 </param>
		/// <returns> 解密后的数据 </returns>
		string PublicKeyDecrypt(string xmlPublicKey, string strDecryptString);
	}
}
